package com.woniuxy.educationplatform.mapper;

import com.woniuxy.educationplatform.bean.TransportBean;
import org.apache.ibatis.annotations.*;

@Mapper
public interface TransportMapper {
    /**
     * 根据id查物流
     * @param id
     * @return
     */
    @Select("select id,trans_no as transNo,status,descr,post_code as postCode from transport_info where id = #{id}")
    TransportBean findById(Long id);


    @Insert("insert into transport_info (trans_no,status,descr,post_code) values" +
            "(#{p.transNo},1,'途中',#{p.postCode})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void add(@Param("p") TransportBean transportBean);
}
